package cd.casic.server.service.impl;

import cd.casic.server.entity.JenkinsPlugin;
import cd.casic.server.utils.JenkinsPluginApiClient;
import cd.casic.server.service.JenkinsPluginInfoService;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;

@Service
public class JenkinsPluginInfoServiceImpl implements JenkinsPluginInfoService {
    String jenkinsUrl = "http://192.168.101.140:8080";
    String username = "admin";
    String apiToken = "11c46eb29c500829cc64cca4cb153c7c9a";
    @Override
    public List<JenkinsPlugin> listAllInstalldePluginInfos() throws IOException {
            // todo
        return new JenkinsPluginApiClient(jenkinsUrl,username,apiToken).getInstalledPlugins();
    }

    @Override
    public List<JenkinsPlugin> listAllAvailablePluginInfos() throws IOException {
        return List.of();
    }
}